<template>
	<view class="articleDetail">
		<h2 class='title'>{{articleDetail.title}}</h2>
		<p class='auth'>作者：{{articleDetail.author}}</p>
		<p class="time">时间：{{articleDetail.createTime}}</p>
		<p class="descr">概要描述：{{articleDetail.summary}}</p>
		<image class="img" :src="articleDetail.coverImg	" mode=""></image>
		<mp-html :content="articleDetail.content1"></mp-html>
	</view>
</template>

<script>
	//api
	import { productArticle } from "@/api/find/index.js"
	export default {
		data() {
			return {
				articleDetail:{}
			};
		},
		onLoad(option) {
			console.log(option.id);
			this.getArticleDetail(option.id);
		},
		methods:{
			getArticleDetail(id){
				productArticle(id).then(res=>{
					// console.log(res);
					let {data}=res.data;
					this.articleDetail=data.productArticle;
					console.log(this.articleDetail);
					uni.setNavigationBarTitle({
						title: data.productArticle.title
					});
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.articleDetail{
	padding: 60rpx;
	.auth{
		text-align: right;
		color: rgb(51, 51, 51);
	}
	.time{
		text-align: right;
		color: rgb(51, 51, 51);
	}
	.img{
		margin: 20rpx 0;
	}
}
</style>
